package com.zusmart.base.network.support;

import com.zusmart.base.activity.support.AbstractActivity;
import com.zusmart.base.network.ChannelAcceptor;
import com.zusmart.base.network.ChannelAdapter;
import com.zusmart.base.network.ChannelOption;
import com.zusmart.base.util.Assert;

public abstract class AbstractChannelAcceptor extends AbstractActivity<ChannelAcceptor> implements ChannelAcceptor {

	private final ChannelOption channelOption;
	private final ChannelAdapter channelAdapter;

	protected AbstractChannelAcceptor(ChannelOption channelOption, ChannelAdapter channelAdapter) {
		Assert.isNull(channelOption, "channel option must not be null");
		Assert.isNull(channelAdapter, "channel adapter must not be null");
		this.channelOption = channelOption;
		this.channelAdapter = channelAdapter;
	}

	@Override
	protected ChannelAcceptor getActivity() {
		return this;
	}

	@Override
	public ChannelOption getChannelOption() {
		return this.channelOption;
	}

	@Override
	public ChannelAdapter getChannelAdapter() {
		return this.channelAdapter;
	}

}